/**
 * 监听点击事件
 */
function menu_click(event, treeId, treeNode) {
	//被选择节点名称
	resourceName = treeNode.name;
	//被选择节点ID
	resourceId = treeNode.id;
	info(resourceId);
	
	//操作按键组显示控制
	$(".new").css("display", "inline");
	$(".delete").css("display", "inline");
	$(".sub").css("display", "inline")
	$(".save").css("display", "none")
};

/**
 * 点击+号，查询下级机构
 */
function menu_click_expand(event, treeId, treeNode){
	//TODO
}

/**
 * 点击减号移除子节点 
 */
function menu_click_remove(event, treeId, treeNode){
	//TODO
}

/**
 *移除资源
 */
function removeResource() {
	var zTree = $.fn.zTree.getZTreeObj("tree_left_id"),
	nodes = zTree.getSelectedNodes(),//当前被选中的节点
	treeNode = nodes[0];
	
	var confirmBox = confirm("确认删除 机构" + treeNode.name + " ，同时删除 "+treeNode.name+" 机构下的所有下级机构吗？");
	if (!confirmBox) {
		return false;
	}
	var callbackFlag = $("#callbackTrigger").attr("checked");
	zTree.removeNode(treeNode, callbackFlag);
	
	$.ajax({
		type : "POST",
		url : "deleteDept.html",
		data : "id="+treeNode.id,
		success : function(data) {
			load_left_tree_();
		},
		error: function(data) {
			checkStatus_xtjx(data.status);
		}
	});
};